package lab02.test03;

public class Student {
    float computerScore;
    float mathScore;
    float englishScore;
    //属性：计算机、数学、英语成绩
    float sum(){
        return computerScore + mathScore + englishScore;
    }
    float  average(){
        return  (computerScore + mathScore + englishScore) / 3;
    }
    float  maxScore(){
    if(computerScore>englishScore&&computerScore>mathScore)
            return computerScore;
        else if (mathScore>englishScore&&mathScore>computerScore)
            return mathScore;
        else return englishScore;}
        //最高分
    float minScore(){
                if (computerScore<mathScore&&computerScore<englishScore)
                    return computerScore;
                else if (mathScore<englishScore&&mathScore<computerScore)
                    return mathScore;
                else return englishScore;
//最低分
    }
        float printfScore(){
            System.out.println(sum());
            System.out.println(average());
            System.out.println(maxScore());
            System.out.println(minScore());
            return printfScore();
//打印
    }
    //行为
}
